/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package checkout;

/**
 *
 * @author Arsonist
 */
public class CheckoutInfo {

    String cardType = "";
    String cardNumber = "";
    String cardHolder = "";
    String cardAddress = "";
    String cardPostcode = "";
    String expiryMonth = "";
    String expiryYear = "";
    String securityCode = "";
    float price = 0;

    public String getCardAddress() {
        return cardAddress;
    }

    public String getCardHolder() {
        return cardHolder;
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public String getCardPostcode() {
        return cardPostcode;
    }

    public String getCardType() {
        return cardType;
    }

    public String getExpiryMonth() {
        return expiryMonth;
    }

    public String getExpiryYear() {
        return expiryYear;
    }

    public String getSecurityCode() {
        return securityCode;
    }

    public float getPrice() {
        return price;
    }

    public void setCardAddress(String cardAddress) {
        this.cardAddress = cardAddress;
    }

    public void setCardHolder(String cardHolder) {
        this.cardHolder = cardHolder;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public void setCardPostcode(String cardPostcode) {
        this.cardPostcode = cardPostcode;
    }

    public void setCardType(String cardType) {
        this.cardType = cardType;
    }

    public void setExpiryMonth(String expiryMonth) {
        this.expiryMonth = expiryMonth;
    }

    public void setExpiryYear(String expiryYear) {
        this.expiryYear = expiryYear;
    }

    public void setSecurityCode(String securityCode) {
        this.securityCode = securityCode;
    }

    public void setPrice(float price) {
        this.price = price;
    }

     public void setAllNull()
    {
         cardType = "";
         cardNumber = "";
         cardHolder = "";
         cardAddress = "";
         cardPostcode = "";
         expiryMonth = "";
         expiryYear = "";
         securityCode = "";
         price =0;
     }

      public String validateInput(String inputCardType, String inputCardNumber, String inputCardHolderName, String inputAddress,
            String inputPostCode, String inputMonth, String inputYear, String inputSecurity){

            String error = "none";
            try{
                 if(inputCardType.equals("")  || inputCardNumber.equals("") || inputCardHolderName.equals("") || inputAddress.equals("") ||
                    inputPostCode.equals("") || inputMonth.equals("") || inputYear.equals("") || inputSecurity.equals("") ){

                    error="Please fill in all fields";
                    }
                }
            catch (NullPointerException e)
            {
                error = "null pointer";
            }
            return error;

    }


}

    